# Maintainer: Caleb Maclennan <caleb@alerque.com>

_pyname=crate
pkgname=python-$_pyname
pkgver=0.34.0
pkgrel=1
pkgdesc='A Python client library for CrateDB'
arch=(any)
url="https://github.com/crate/crate-python"
license=(Apache)
depends=(python
         python-urllib3)
makedepends=(python-{build,installer,wheel}
             python-setuptools)
optdepends=(python-sqlalchemy)
_archive="$_pyname-$pkgver"
source=("https://files.pythonhosted.org/packages/source/${_pyname::1}/$_pyname/$_archive.tar.gz")
sha256sums=('9c45ab7c277631009c20ce9d2e455873f7164f9c1c4ffa6f61a636577c1fbada')

build() {
	cd "$_archive"
	python -m build -wn
}

package() {
	cd "$_archive"
	python -m installer -d "$pkgdir" dist/*.whl
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
	install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" {CONTRIBUTING,DEVELOP,README}.rst
}
